<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>用户管理系统</title>
	<style type="text/css">
		*{
			margin: 0px;
			padding: 0px;
			color:#424242;
		}
		#tit{
			margin: 20px 0 0 20px;
		}
		#tit h1{
			color: #0A8;
			font-size: 50px;
		}
		.outside{
			width:1500px;
			height:2px;
			background-color: #0A8;
		}
		#login{
			position: absolute;
			top: 50%;
			left: 50%;
			margin: -150px 0 0 -150px;
			width: 300px;
			height: 300px;
		}
		input {    
		    width: 278px;    
		    height: 18px;    
		    margin-bottom: 10px;    
		    outline: none;    
		    padding: 10px;    
		    font-size: 13px;    
		    color: #0A8;      
		    border: 1px solid #0A8;       
		    border-radius: 10px;  
		    background-color: #fff;         
		}
		#login h1{    
		    color: #0A8;    
		    font-size: 40px;    
		    margin: 20px 20px 10px 110px;    
		}
		.but{    
		    width: 300px;    
		    min-height: 20px;    
		    display: block;    
		    background-color: #fff;    
		    border: 1px solid #0A8;    
		    color: #0A8;    
		    padding: 9px 14px;    
		    font-size: 15px;    
		    border-radius: 10px;    
		} 
	</style>
	<script>

	</script>
</head>
<body bgcolor="#BFE">
	<script>
		function CheckForm(form) {
			var username = document.getElementById('Username').value;
			var password = document.getElementById('Password').value;
			for (var i=0; i<parseInt(localStorage.length/5); ++i)
				if(localStorage.getItem(i+1)==username && localStorage.getItem("password"+(i+1))==password){
					alert("登录成功！");
					window.location.href='../第三次作业/work3.html';
			  		window.event.returnValue = false;
			  		return ture;
				}
				else if (localStorage.getItem(i+1)==username){
					alert("用户名或密码错误！");
					return false;
				}
			alert("该用户不存在！");
			return false;
		}
	</script>
	<div id="tit">
		<h1>用户管理系统</h1>
	</div>
	<div class="outside"></div>
	<div id="login">
		<form name="Userform" onsubmit="return CheckForm(this)">
		<h1>登录</h1>
		<p>
			<input type="text" placeholder="用户名" name="Username" id="uName"></input>
		</p>
		<p>
			<input type="password" placeholder="●●●●●●●●" name="Password" id="uPass"></input>
		</p>
			<input type="submit" value="登录" name="LogIn" style="height: 45px;width: 300px;font-size: 20px; text-align:center;"></input>
		</form>
	</div>
</body>
</html>